package com.niiwoo.activity.stage.enums.invite;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Desc:
 * Create by scrawl on 2018/3/23
 */
@Getter
@AllArgsConstructor
public enum InviteRewardTypeEnum {
    // 奖励类型(1.开通借款存管，2开通投资存管,3.首次借款账户充值，4.首次投资账户充值，5.推荐投资，6推荐借款)
    OPEN_BORROW_ACCOUNT((byte) 1, "开通借款存管"),
    OPEN_INVEST_ACCOUNT((byte) 2, "开通借款存管"),
    FIRST_BORROW_RECHARGE((byte) 3, "首次借款账户充值"),
    FIRST_INVEST_RECHARGE((byte) 4, "首次投资账户充值"),
    RECOMMEND_INVEST((byte) 5, "推荐投资"),
    RECOMMEND_BORROW((byte) 6, "推荐借款");

    private byte value;
    private String desc;

    public static InviteRewardTypeEnum enumOf(Byte value) {
        for (InviteRewardTypeEnum typeEnum : values()) {
            if (typeEnum.value == value) {
                return typeEnum;
            }
        }
        throw new NoSuchEnumValueException("InviteRewardTypeEnum:" + value);
    }
}
